package com.kid.keep.mapper;

import com.honeybee.cloud.framework.common.mapper.BaseCovertMapper;
import com.kid.keep.bo.MessageBO;
import com.kid.keep.dto.MessageDTO;
import com.kid.keep.po.CheckItemReport;
import com.kid.keep.po.Message;
import com.kid.keep.vo.MessageVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.Date;
import java.util.List;

/**
 * @Description message
 * @Author JOHN
 * @Create 2020-01-13
 * @Since 1.0.0
 */
@Mapper(componentModel = "spring")
public interface IMessageCovertMapper extends BaseCovertMapper {

    /**
     * po to  dto
     *
     * @param message
     * @return
     */

    MessageDTO toDTO(MessageBO message);

    /**
     * po to  dto
     *
     * @param message
     * @return
     */

    List<MessageDTO> toDTO(List<MessageBO> message);

    /**
     * dto to  vo
     *
     * @param message
     * @return
     */
    @Mappings({
            @Mapping(target = "id", source = "id", qualifiedByName = "toString"),
            @Mapping(target = "reportId", source = "reportId", qualifiedByName = "toString"),
            @Mapping(target = "childId", source = "childId", qualifiedByName = "toString"),
    })
    MessageVO toVO(MessageDTO message);


    /**
     * dto to vo
     *
     * @param message
     * @return
     */

    List<MessageVO> toVO(List<MessageDTO> message);

}
